package com.lyf.design.practice.theory.create.singleton;

/**
 * 静态匿名内部类
 * 饿汉式，在加载外部类时，不会加载内部类
 *
 * @author LYF
 * @date 2022/6/19
 */
public class Singleton4 {
    private static class Singleton{
        static final Singleton4 INSTANCE = new Singleton4();
    }
    private Singleton4(){}
    public static Singleton4 getInstance(){return Singleton.INSTANCE;}
}
